|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
FreeMASTER driver private declarations, used internally by the driver. More...
#include "freemaster_MPC56xx.h"Go to the source code of this file.
Defines | |
| #define | NULL ((void *) 0) |
| #define | FMSTR_TRUE (1U) |
| #define | FMSTR_FALSE (0U) |
| #define | FMSTR_INLINE static |
| #define | FMSTR_MACROCODE_BEGIN() do{ |
| #define | FMSTR_MACROCODE_END() }while(0) |
| #define | FMSTR_UNUSED(sym) ((sym),0) |
| #define | FMSTR_USE_SERIAL 0 |
| #define | FMSTR_COMM_BUFFER_SIZE 0 |
Functions | |
| FMSTR_BOOL | FMSTR_InitSerial (void) |
| Serial communication initialization. | |
| void | FMSTR_SendResponse (FMSTR_BPTR pMessageIO, FMSTR_SIZE8 nLength) |
| Finalize transmit buffer before transmitting. | |
| void | FMSTR_ProcessSCI (void) |
| Handle SCI communication (both TX and RX) | |
| void | FMSTR_ProcessJTAG (void) |
| FMSTR_BOOL | FMSTR_Tx (FMSTR_U8 *pTxChar) |
| Output buffer transmission. | |
| FMSTR_BOOL | FMSTR_Rx (FMSTR_U8 nRxChar) |
| Handle received character. | |
| FMSTR_BOOL | FMSTR_ProtocolDecoder (FMSTR_BPTR pMessageIO) |
| Decodes the FreeMASTER protocol and calls appropriate handlers. | |
| FMSTR_BPTR | FMSTR_GetBoardInfo (FMSTR_BPTR pMessageIO) |
| Handling GETINFO or GETINFO_BRIEF. | |
| FMSTR_BPTR | FMSTR_ReadMem (FMSTR_BPTR pMessageIO) |
| Handling READMEM and READMEM_EX commands. | |
| FMSTR_BPTR | FMSTR_ReadVar (FMSTR_BPTR pMessageIO, FMSTR_SIZE8 nSize) |
| Handling READVAR and READVAR_EX commands (for all sizes 1,2,4) | |
| FMSTR_BPTR | FMSTR_WriteMem (FMSTR_BPTR pMessageIO) |
| Handling WRITEMEM and WRITEMEM_EX commands. | |
| FMSTR_BPTR | FMSTR_WriteVar (FMSTR_BPTR pMessageIO, FMSTR_SIZE8 nSize) |
| Handling WRITEVAR command. | |
| FMSTR_BPTR | FMSTR_WriteVarMask (FMSTR_BPTR pMessageIO, FMSTR_SIZE8 nSize) |
| Handling WRITEVARMASK command. | |
| FMSTR_BPTR | FMSTR_WriteMemMask (FMSTR_BPTR pMessageIO) |
| Handling WRITEMEMMASK and WRITEMEMMASK_EX commands. | |
| void | FMSTR_InitAppCmds (void) |
| Initialize app.cmds interface. | |
| FMSTR_BPTR | FMSTR_StoreAppCmd (FMSTR_BPTR pMessageIO) |
| Handling SANDAPPCMD command. | |
| FMSTR_BPTR | FMSTR_GetAppCmdStatus (FMSTR_BPTR pMessageIO) |
| Handling GETAPPCMDSTS command. | |
| FMSTR_BPTR | FMSTR_GetAppCmdRespData (FMSTR_BPTR pMessageIO) |
| Handling GETAPPCMDDATA command. | |
| void | FMSTR_InitScope (void) |
| Scope Initialization. | |
| FMSTR_BPTR | FMSTR_SetUpScope (FMSTR_BPTR pMessageIO) |
| Handling SETUPSCOPE and SETUPSCOPE_EX command. | |
| FMSTR_BPTR | FMSTR_ReadScope (FMSTR_BPTR pMessageIO) |
| Handling READSCOPE command. | |
| void | FMSTR_InitRec (void) |
| Recorder Initialization. | |
| FMSTR_BPTR | FMSTR_SetUpRec (FMSTR_BPTR pMessageIO) |
| Handling SETUPREC and SETUPREC_EX commands. | |
| FMSTR_BPTR | FMSTR_StartRec (FMSTR_BPTR pMessageIO) |
| Handling STARTREC command. | |
| FMSTR_BPTR | FMSTR_StopRec (FMSTR_BPTR pMessageIO) |
| Handling STOPREC command. | |
| FMSTR_BPTR | FMSTR_GetRecStatus (FMSTR_BPTR pMessageIO) |
| Handling GETRECSTS command. | |
| FMSTR_BPTR | FMSTR_GetRecBuff (FMSTR_BPTR pMessageIO) |
| Handling GETRECBUFF and GETRECBUFF_EX command. | |
| FMSTR_BOOL | FMSTR_IsInRecBuffer (FMSTR_ADDR nAddr, FMSTR_SIZE8 nSize) |
| Check wether given memory region is inside the recorder buffer. | |
| FMSTR_SIZE | FMSTR_GetRecBuffSize (void) |
| Get recorder memory size. | |
| void | FMSTR_InitTsa (void) |
| TSA Initialization. | |
| FMSTR_BPTR | FMSTR_GetTsaInfo (FMSTR_BPTR pMessageIO) |
| Handling GETTSAINFO and GETTSAINFO_EX command. | |
| FMSTR_BPTR | FMSTR_GetStringLen (FMSTR_BPTR pMessageIO) |
| Handling GETSTRLEN and GETSTRLEN_EX commands. | |
| FMSTR_BOOL | FMSTR_CheckTsaSpace (FMSTR_ADDR nAddr, FMSTR_SIZE8 nSize, FMSTR_BOOL bWriteAccess) |
| Check wether given memory region is "safe" (covered by TSA) | |
| FMSTR_U16 | FMSTR_StrLen (FMSTR_ADDR nAddr) |
| Private inline implementation of "strlen" used by TSA and Pipes. | |
| void | FMSTR_InitSfio (void) |
| FMSTR_BPTR | FMSTR_SfioFrame (FMSTR_BPTR pMessageIO) |
| FMSTR_BPTR | FMSTR_SfioGetResp (FMSTR_BPTR pMessageIO) |
| void | FMSTR_InitPipes (void) |
| FMSTR_BPTR | FMSTR_PipeFrame (FMSTR_BPTR pMessageIO) |
| void | FMSTR_InitCan (void) |
| void | FMSTR_SetCanCmdID (FMSTR_U32 canID) |
| void | FMSTR_SetCanRespID (FMSTR_U32 canID) |
| FMSTR_BOOL | FMSTR_TxCan (void) |
| FMSTR_BOOL | FMSTR_RxCan (void) |
| void | FMSTR_ProcessCanRx (void) |
| void | FMSTR_ProcessCanTx (void) |
| void | FMSTR_InitPDBdm (void) |
FreeMASTER driver private declarations, used internally by the driver.
| FMSTR_BOOL FMSTR_CheckTsaSpace | ( | FMSTR_ADDR | dwAddr, |
| FMSTR_SIZE8 | nSize, | ||
| FMSTR_BOOL | bWriteAccess | ||
| ) |
Check wether given memory region is "safe" (covered by TSA)
| dwAddr | - address of the memory to be checked |
| nSize | - size of the memory to be checked |
| bWriteAccess | - write access is required |
| FMSTR_BPTR FMSTR_GetAppCmdRespData | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETAPPCMDDATA command.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_GetAppCmdStatus | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETAPPCMDSTS command.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_GetBoardInfo | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETINFO or GETINFO_BRIEF.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_GetRecBuff | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETRECBUFF and GETRECBUFF_EX command.
| pMessageIO | - original command (in) and response buffer (out) |
This function returns recorder buffer information
| FMSTR_SIZE FMSTR_GetRecBuffSize | ( | void | ) |
Get recorder memory size.
| FMSTR_BPTR FMSTR_GetRecStatus | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETRECSTS command.
| pMessageIO | - original command (in) and response buffer (out) |
This function returns current recorder status
| FMSTR_BPTR FMSTR_GetStringLen | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETSTRLEN and GETSTRLEN_EX commands.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_GetTsaInfo | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETTSAINFO and GETTSAINFO_EX command.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BOOL FMSTR_IsInRecBuffer | ( | FMSTR_ADDR | dwAddr, |
| FMSTR_SIZE8 | nSize | ||
| ) |
Check wether given memory region is inside the recorder buffer.
| dwAddr | - address of the memory to be checked |
| wSize | - size of the memory to be checked |
This function is called as a part of TSA-checking process when the PC host is requesting memory contents
| void FMSTR_ProcessSCI | ( | void | ) |
Handle SCI communication (both TX and RX)
This function checks the SCI flags and calls the Rx and/or Tx functions
| FMSTR_BOOL FMSTR_ProtocolDecoder | ( | FMSTR_BPTR | pMessageIO | ) |
Decodes the FreeMASTER protocol and calls appropriate handlers.
| pMessageIO | - message in/out buffer |
This Function decodes given message and invokes proper command handler which fills in the response. The response transmission is initiated in this call as well.
| FMSTR_BPTR FMSTR_ReadMem | ( | FMSTR_BPTR | pMessageIO | ) |
Handling READMEM and READMEM_EX commands.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_ReadScope | ( | FMSTR_BPTR | pMessageIO | ) |
Handling READSCOPE command.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_ReadVar | ( | FMSTR_BPTR | pMessageIO, |
| FMSTR_SIZE8 | nSize | ||
| ) |
Handling READVAR and READVAR_EX commands (for all sizes 1,2,4)
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BOOL FMSTR_Rx | ( | FMSTR_BCHR | nRxChar | ) |
Handle received character.
| nRxChar | The character to be processed |
Handle the character received and -if the message is complete- call the protocol decode routine.
| void FMSTR_SendResponse | ( | FMSTR_BPTR | pResponse, |
| FMSTR_SIZE8 | nLength | ||
| ) |
Finalize transmit buffer before transmitting.
| nLength | - response length (1 for status + data length) |
This Function takes the data already prepared in the transmit buffer (inlcuding the status byte). It computes the check sum and kicks on tx.
| FMSTR_BPTR FMSTR_SetUpRec | ( | FMSTR_BPTR | pMessageIO | ) |
Handling SETUPREC and SETUPREC_EX commands.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_SetUpScope | ( | FMSTR_BPTR | pMessageIO | ) |
Handling SETUPSCOPE and SETUPSCOPE_EX command.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_StartRec | ( | FMSTR_BPTR | pMessageIO | ) |
Handling STARTREC command.
| pMessageIO | - original command (in) and response buffer (out) |
This function starts recording (initializes internal recording variables and flags)
| FMSTR_BPTR FMSTR_StopRec | ( | FMSTR_BPTR | pMessageIO | ) |
Handling STOPREC command.
| pMessageIO | - original command (in) and response buffer (out) |
This function stops recording (same as manual trigger)
| FMSTR_BPTR FMSTR_StoreAppCmd | ( | FMSTR_BPTR | pMessageIO | ) |
Handling SANDAPPCMD command.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BOOL FMSTR_Tx | ( | FMSTR_U8 * | pTxChar | ) |
Output buffer transmission.
| pTxChar | The character to be transmit |
get ready buffer(prepare data to send)
| FMSTR_BPTR FMSTR_WriteMem | ( | FMSTR_BPTR | pMessageIO | ) |
Handling WRITEMEM and WRITEMEM_EX commands.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_WriteMemMask | ( | FMSTR_BPTR | pMessageIO | ) |
Handling WRITEMEMMASK and WRITEMEMMASK_EX commands.
| pMessageIO | - original command (in) and response buffer (out) |
| FMSTR_BPTR FMSTR_WriteVar | ( | FMSTR_BPTR | pMessageIO, |
| FMSTR_SIZE8 | nSize | ||
| ) |
Handling WRITEVAR command.
| pMessageIO | - original command (in) and response buffer (out) |
| nSize | - variable size |
| FMSTR_BPTR FMSTR_WriteVarMask | ( | FMSTR_BPTR | pMessageIO, |
| FMSTR_SIZE8 | nSize | ||
| ) |
Handling WRITEVARMASK command.
| pMessageIO | - original command (in) and response buffer (out) |
| nSize | - variable size |